﻿using AdminSystem.Application.Commands.ShopCommands;
using AdminSystem.Domain.Entities;
using AdminSystem.EntityFramworkCore;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace AdminSystem.WebAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ShopController : ControllerBase
    {
        private readonly IMediator mediator;
        public ShopController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public async Task<APIResult<List<Shop>>> GetShop()
        {
            ShopQueryCommand command = new ShopQueryCommand();
            return await mediator.Send(command);
        }
    }
}
